package com.nulldev.util.web.nTube.util;

import java.util.Map;

import com.nulldev.util.data.Arrays.maps.FastMaps;

public class APIWarnings {

	private static final Map<Integer, String> WARNING_MAP = FastMaps.map();
	private static final String UNKNOWN_WARNING_TEXT = "Unknown warning, something went wrong.";

	static {
		if (WARNING_MAP.isEmpty()) {
			WARNING_MAP.put(0, UNKNOWN_WARNING_TEXT);
			WARNING_MAP.put(7, "No AAC streams were found.");
			WARNING_MAP.put(8, "Providing videoID via URL queries should be avoided and body JSON should be used instead.");
			WARNING_MAP.put(14, "The 'extractor' argument is deprecated, you should avoid using this.");
			WARNING_MAP.put(15, "'audio' has been removed.");
			WARNING_MAP.put(24, "DRM support in nTube is WYSIWYG at the moment, expect stuff to break.");
			WARNING_MAP.put(29, "API Level 1.7 is experimental and incomplete.");
			WARNING_MAP.put(30, "Newer API levels are incomplete and return incorrect or missing data.");
			WARNING_MAP.put(31, "Older API levels are deprecated and should not be used.");
			WARNING_MAP.put(32, "Clients should use videoAPIVersionNS instead of videoAPIVersion.");
			WARNING_MAP.put(33, "The related videos array contains a non-standard object with a continuation.");
		}
	}

	public static String get(final int key) {
		return WARNING_MAP.getOrDefault(key, UNKNOWN_WARNING_TEXT);
	}
}
